{extend name='public/base' /}

{block name="style"}
{css href="/static/umeditor/themes/default/css/umeditor.css" /}
{css href="/node_modules/ztree/css/zTreeStyle/zTreeStyle.css" /}
{/block}

{block name="breadcrumb"}
{$crumbs}
{/block}

{block name="body"}
<div class="col-lg-12">
    <div class="ibox float-e-margins">
        <div class="ibox-content">
            <div class="row">
                <div class="col-sm-6 b-r">
                    <h3 class="m-t-none m-b"></h3>
                    <form role="form" action="{:url('save_category')}" method="post" autocomplete="off" data-form="form">
                        <div class="form-group">
                            <label>分类名称</label>
                            <input type="text" name="name" placeholder="accounts" class="form-control" value="{$cate.name|default=''}">
                        </div>
                        <div class="form-group">
                            <label>上级分类</label>
                            <select class="select2_demo_1 form-control" name="cate_id">
                                <option value="1">顶级分类</option>
                                {volist name="cates" id="vo"}
                                <option value="{$vo.id}" {eq name="vo.id" value="$cate.pid|default=0"}selected{/eq}>{$vo.level|str_repeat=' -- ', ###}{$vo.name} </option>
                                {/volist}
                            </select>
                        </div>
                        <div>
                            <input type="hidden" name="id" value="{$cate.id|default=0}">
                            <input type="hidden" name="pid" id="category_id" value="{$cate.pid|default=0}">
                            <button class="btn btn-sm btn-primary m-t-n-xs" type="submit"><strong>确定</strong></button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}

{block name="javascript"}
<!-- Select2 -->
{js href="/static/inspinia/js/plugins/select2/select2.full.min.js" /}
{/block}